from selenium import webdriver
import time


def http_requests(a=int(1)):
    client.get("https://spa3.scrape.center/")
    while a < 5:
        time.sleep(5)
        # var q=document.getElementById('index').scrollTop=10000
        client.execute_script("var q=document.getElementById('index').scrollTop=10000")
        a += int(1)
    html = client.page_source
    with open("home.html", "w", encoding='utf-8') as f:
        f.write(html)
    return html


def main():
    html = http_requests()
    print(html)


if __name__ == "__main__":
    client = webdriver.Chrome()
    main()
